using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;

namespace ColladaDotNet
{
	public class ColladaXmlNode
	{
		public virtual string GetSid()
		{
			return null;
		}
		public virtual string GetId()
		{
			return null;
		}
		static ColladaXmlNode[] emptyNodes = new ColladaXmlNode[]{};
		[XmlIgnore]
		public virtual IList<ColladaXmlNode> ChildNodes
		{
			get
			{
				return emptyNodes;
			}
		}
		public ColladaXmlNode GetElementBySid(string sid)
		{
			var children = ChildNodes;
			ColladaXmlNode res;
			foreach (var child in children)
			{
				if (sid == child.GetSid())
					return child;
			}
			foreach (var child in children)
			{
				res = child.GetElementBySid(sid);
				if (res != null)
					return res;
			}
			return null;
		}

	}
}
